const jade = require('jade');
const fs = require('fs');
//方法是writeFile,而不是write

//这次返回值是渲染好的参数
var str = jade.renderFile('./views/2.jade',{pretty:true});
fs.writeFile('./views/2.html',str,function (err,data) {
    if(err){
        console.log('err')
    }else{
        console.log(data)
    }
})